#define   _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int n = 0;
	int Sn = 0;
	int sums = 0;
	while (scanf("%d", &n) != EOF)
	{
		for (int i = 0; i < 5; i++)
		{
			Sn = n + Sn * 10;
			sums += Sn;
		}
		printf("%d", sums);
	}
	return 0;
}